package com.dm.schedule;

import com.dm.service.MigrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 *
 * [迁移定时任务].
 * [可调用Service中方法]
 * <h3>version info：</h3><br>
 * v1.0 2020年09月24日 Eric Wang创建<br>
 * <br>
 * @author Eric Wang
 * @version 1.0
 * @since JDK 1.8
 */
@Component
public class DmMigrationSchedule {

    @Autowired
    MigrationService migrationService;
    /**
     * 表示 每隔 5000 毫秒执行一次
     */
    @Scheduled(fixedRate = 5000)
    public void reportCurrentTime() {
        System.out.println("每隔五秒钟执行一次： " + System.currentTimeMillis());
        migrationService.DataMigrationExm();
    }



}
